<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>编辑人员</title>
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/easyui/themes/default/easyui.css" />
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/easyui/themes/icon.css" />
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/cms.css" />
	<script type="text/javascript" src="<%=request.getContextPath() %>/easyui/jquery.min.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath() %>/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath() %>/easyui/locale/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript">
		var init = {"nickname": '${userVO.nickname}',
					'username':'${userVO.username}',
					'password':'${userVO.password}',
					'state':'${userVO.state}',
					'id':'${userVO.id}'};	
		
		$(function(){
			if(init.id != '0'){
				$('#fm').form('load',init);
			}
		});
	
		function submitForm(){
			
			$('#fm').form('submit', {
				url: "<%=request.getContextPath() %>/user/saveUser.do",
				onSubmit: function(){
					return $(this).form('validate');
				},
				success: function(msg){
					if("success" == msg){
			        	parent.reloadDg();
			        } else {
			        	$.messager.alert('Warning','<br />' + msg);
			        }
				}
			});
	
		}
	</script>
</head>
<body class="easyui-layout">
	<div data-options="region:'center',border:false">
		<form id="fm" method="post">
			<input type="hidden" name="id" value="0"/>
			<div>
				<table>
					<tr>
						<td class="fm_title"><font color="red">*&nbsp;</font>姓名</td>
						<td><input type='text' name="nickname" class='easyui-validatebox in-text ' 
								data-options="required:true" /></td>
					</tr>
					<tr>
						<td class="fm_title"><font color="red">*&nbsp;</font>用户名</td>
						<td><input type='text' name="username" class='in-text easyui-validatebox' 
								data-options="required:true" /></td>
					</tr>
					<tr>
						<td class="fm_title"><font color="red">*&nbsp;</font>密码</td>
						<td><input type="password" name="password" class='in-text easyui-validatebox' 
								data-options="required:true" /></td>
					</tr>
					<tr>
						<td class="fm_title"><font color="red">*&nbsp;</font>状态</td>
						<td>
							<input type="radio" name="state" value="1" checked="checked"/><label>启用</label>&nbsp;&nbsp;
							<input type="radio" name="state" value="2"/><label>禁用</label>
						</td>
					</tr>
				</table>
			</div>
		</form>
	</div>
	<div data-options="region:'south',border:false" class="fm-btn">
		<a href="javascript:submitForm()" class="easyui-linkbutton" iconCls="icon-ok">确定</a>
		<a href="javascript:parent.closeWin()" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
	</div>
</body>
</html>